<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:s="http://jboss.com/products/seam/taglib"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:rich="http://richfaces.org/rich"
	template="/layout/template.xhtml">

	<ui:define name="body">

		<rich:panel>
			<f:facet name="header">Installed RecipeImportServices</f:facet>

			<div class="importServices">
			    <h:outputText value="No RecipeImportService is installed!"
				           rendered="#{empty importServices}" /> 
				<h:dataTable id="importServiceList" 
				            var="service" 
				          value="#{importServices}"
				       rendered="#{not empty importServices}">
					<h:column>
						<f:facet name="header">Name</f:facet>
						<h:outputText value="#{service.name}" />
	                </h:column>
					<h:column>
						<f:facet name="header">Url</f:facet>
						<h:outputLink value="#{service.url}">
							<h:outputText value="#{service.url}" />
						</h:outputLink>
					</h:column>
			    </h:dataTable>
			</div>
		</rich:panel>
		<h:form id="recipeImportForm">
			<rich:panel>
				<f:facet name="header">Recipe</f:facet>

				<s:decorate id="urlField" template="/layout/edit.xhtml">
					<ui:define name="label">URL</ui:define>
					<h:inputText id="url" 
					           size="80"
					       required="true"
						      value="#{recipeImport.url}" />
				</s:decorate>
    				
				<div style="clear: both" />
			</rich:panel>

			<div class="actionButtons">
			    <h:commandButton id="import"
				              value="Import" 
				             action="#{recipeImport.execute}" /> 
				<s:button id="cancel" 
				 propagation="none" 
				       value="Cancel"
				        view="/view/recipeList.xhtml" />
		    </div>
		</h:form>

	</ui:define>

</ui:composition>
